UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y5ny50rhhjOadqbMHABmpfK4RyJutGQzFCfRfMOYNyo=' 
WHERE 
  key_id = '08e76dfa5d8fb6d7fa4e8997bc5aae0c84be9aea6ad4624d2680ce2407aa5266' 
  AND (
    token = 'Y5ny50rhhjOadqbMHABmpfK4RyJutGQzFCfRfMOYNyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031