UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+zzy4A5bLy/RvIy9uzf/YdsT1QukC01fVXzUNnZrWCw=' 
WHERE 
  key_id = 'd1e54461b1367a3e85880f0cf2f23994ac848fd031ad75124f03af5ac1b34648' 
  AND (
    token = '+zzy4A5bLy/RvIy9uzf/YdsT1QukC01fVXzUNnZrWCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00094