UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Xqafh9Qzb57vpL+sFoHBut8WMAbUmW1DnUfBXhzpJ4=' 
WHERE 
  key_id = '6e35b8e094557d8b993db32db274cd9db01f5fb57ec871621c10f98ae356159c' 
  AND (
    token = '0Xqafh9Qzb57vpL+sFoHBut8WMAbUmW1DnUfBXhzpJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031