UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JtjlzT6dbrvQmrOHy9X1LGEa7YpH/D8XfBzITAUL8GI=' 
WHERE 
  key_id = 'addd96f238c7f82134b5fb4ffa2064b26a2eaa4884efed7286c24686a5a81f81' 
  AND (
    token = 'JtjlzT6dbrvQmrOHy9X1LGEa7YpH/D8XfBzITAUL8GI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024