UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UFcwWNFrHtlU01JzOxrCrk0ksjJ2wLPbAYlQKujnGik=' 
WHERE 
  key_id = '0ed5f7db373d6257f70b90659bf37b819986ecebe3d18a6b5488879bf655482f' 
  AND (
    token = 'UFcwWNFrHtlU01JzOxrCrk0ksjJ2wLPbAYlQKujnGik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031