UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't4Tu8DJ9IOEK06GFaBN1Xl4RVhIeEwINrfhkR3cwG88=' 
WHERE 
  key_id = '0d9de1db1515085f44485967d01c0c8176fbda9d2cd41f6af5276d7ac087eb48' 
  AND (
    token = 't4Tu8DJ9IOEK06GFaBN1Xl4RVhIeEwINrfhkR3cwG88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024