UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/U0s7jEE/28yljsfvwBd2FA3oiCQpsNoZNa19NxLM0Q=' 
WHERE 
  key_id = '796dece10a779ebd81de7ca72722358cf95c98c0024dd23d791f597e02a8a7c7' 
  AND (
    token = '/U0s7jEE/28yljsfvwBd2FA3oiCQpsNoZNa19NxLM0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032