UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6UxhIGVKr28puS61vMs05K+WpNv+Gd6UklV7QWsYLh8=' 
WHERE 
  key_id = '5efe6a98b44266716c27c8356c811a4c9b5c91a03d67519a25cac989ffd0d621' 
  AND (
    token = '6UxhIGVKr28puS61vMs05K+WpNv+Gd6UklV7QWsYLh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033