UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i3PqMT5UAMk0WCkTEKzRc453CEZP9+RHc2YWOTqzDas=' 
WHERE 
  key_id = 'e8e191b27de9bdc8bd3624504fb1d95af788338785f9dd408a7b668a9e1789fe' 
  AND (
    token = 'i3PqMT5UAMk0WCkTEKzRc453CEZP9+RHc2YWOTqzDas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024