UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9T/Gvfk/g8lJoabK8UyX7nTkWb2QrihQH8DG2uyqjSA=' 
WHERE 
  key_id = '4195198ae4a313ae61e465c748423516d1d965fc1de7f26442a2773910f8b612' 
  AND (
    token = '9T/Gvfk/g8lJoabK8UyX7nTkWb2QrihQH8DG2uyqjSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021