UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'esiLyDfIfEvMQfuY8xbZ0bCoOmo88h2xGw0YwpkJB1A=' 
WHERE 
  key_id = '05465c62601e7a7894b526b3a42529db3489836ccf2b9c3d5148fe894cee6b81' 
  AND (
    token = 'esiLyDfIfEvMQfuY8xbZ0bCoOmo88h2xGw0YwpkJB1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028