UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'roWwjJtAmirys/q8ZinjZNst+Br1P/43RyHsAzc3SMw=' 
WHERE 
  key_id = '045b1dd511cf39d107a4a6b6317db730330a7bc784d5b9607043e666ebc22a35' 
  AND (
    token = 'roWwjJtAmirys/q8ZinjZNst+Br1P/43RyHsAzc3SMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043