UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tbh9azkYiXG+YdMh56oGGTcjdZ/rEvEC5HMIIuHwz7U=' 
WHERE 
  key_id = '15cac8fe0436327c81f4b24d7540955aa8ca0a301592b86d18515aab659c09e8' 
  AND (
    token = 'tbh9azkYiXG+YdMh56oGGTcjdZ/rEvEC5HMIIuHwz7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031