UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QFekBNPfZiEw9j0AZ1L03HHeeSrxmoYKXdxuZesNFd4=' 
WHERE 
  key_id = '69d51eeaf716a5829cb3505b89711b0d11fc853a2b7a411dc5f4711c9000d617' 
  AND (
    token = 'QFekBNPfZiEw9j0AZ1L03HHeeSrxmoYKXdxuZesNFd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016