UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JotP3cgdxJ4ddUicTeTeq3Smuh6I+BSvhqODsqmHHaI=' 
WHERE 
  key_id = 'b914fc210566cd4b01f72ee1adc9e9c435073304beb2dafebd8a8fb87c7198ba' 
  AND (
    token = 'JotP3cgdxJ4ddUicTeTeq3Smuh6I+BSvhqODsqmHHaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034