UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3J8LwCWJWIuW0Kv33lq7NB6vtGbA/jcgWpKYI2gdpDY=' 
WHERE 
  key_id = '071d06f1e36360303d31ba0ccd7171c4c624bb3e2fbfe0bfa4aff9a7079e4b92' 
  AND (
    token = '3J8LwCWJWIuW0Kv33lq7NB6vtGbA/jcgWpKYI2gdpDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045