UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wh4m1fH4S9oHMcJiH880sq06bHztArP2Tqz4Hbxs4Hw=' 
WHERE 
  key_id = '553887eab608c93e5ea88562f63fe1a961b17348ba6a22caaf31f98197ff97af' 
  AND (
    token = 'wh4m1fH4S9oHMcJiH880sq06bHztArP2Tqz4Hbxs4Hw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030