UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Oo/6mH3dyA2gUqlPJvnPq7Scai2UMp/UiEKdPrsxIQ=' 
WHERE 
  key_id = 'cc253dfc90d2eac7b2502018efd9786a389f64d9ef2104729d44a2a9cb3b367c' 
  AND (
    token = '9Oo/6mH3dyA2gUqlPJvnPq7Scai2UMp/UiEKdPrsxIQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017