UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/0z9ET55LmlGhd3pUreQvEEYNwdweGNMK5zlRn7lb2M=' 
WHERE 
  key_id = '494b29f40003bfc0eec7349cf5d6aa34f9cba5622e07715e62d7c54380b19030' 
  AND (
    token = '/0z9ET55LmlGhd3pUreQvEEYNwdweGNMK5zlRn7lb2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037