UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D0O0PIXqOIqOCE9siGIcLdqlGS4ZSJpCecqnB8sIhTQ=' 
WHERE 
  key_id = 'fa84f79554a8ad90a9f72a45332a17d33004f3277fc8d7d2ecc1fa2a98d0594d' 
  AND (
    token = 'D0O0PIXqOIqOCE9siGIcLdqlGS4ZSJpCecqnB8sIhTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025