UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tTjuAF/GnkQXgZ6Axti0irNq44xhrdpF5dBBICU4sPc=' 
WHERE 
  key_id = '7b8120e810784949f7dc1b7389b2359d7361a90a88d050f79c881bca1e56eef8' 
  AND (
    token = 'tTjuAF/GnkQXgZ6Axti0irNq44xhrdpF5dBBICU4sPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027