UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gLIC2wOvKF60izCRgi4A0ETLEF/rVz1HXbd8cQGCp9w=' 
WHERE 
  key_id = '60f29dec0a36cbeff783f4ccc95188e93dd8ae93257ec1414e986fd1bb2c080f' 
  AND (
    token = 'gLIC2wOvKF60izCRgi4A0ETLEF/rVz1HXbd8cQGCp9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026