UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1LV9fOJfleAxVk7WSIFKuRLpw75qw+hqfRIbNrow7b8=' 
WHERE 
  key_id = '7a2b0cbb011be05b0bba1b54993a63adfdd93f65afa4bf32b6b04205e0620e80' 
  AND (
    token = '1LV9fOJfleAxVk7WSIFKuRLpw75qw+hqfRIbNrow7b8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029