UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2E0a9kZwQ5Dqszu3FuaJGel7G3npVmije7vBt0wRJJs=' 
WHERE 
  key_id = 'fed007583df1d4aaabf28b9d37098c58f4313603ab11509e6c4737c16295367a' 
  AND (
    token = '2E0a9kZwQ5Dqszu3FuaJGel7G3npVmije7vBt0wRJJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030