UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pe7JnsROGXw5F/xWISFaekWmzhvLcCzITtB8Biy2vYs=' 
WHERE 
  key_id = 'ad3878bb8e1b89d4a5027fb60bc19cb283eabeb5c8eb3e92c2540c74bf2c4a8b' 
  AND (
    token = 'Pe7JnsROGXw5F/xWISFaekWmzhvLcCzITtB8Biy2vYs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024