UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IpdDsIubOG/ntlCdzaiOJxCrZ4w3qs8hrWCv/7texzA=' 
WHERE 
  key_id = '1b330d84e265d4cc2073aaf571948d61980c24bdded2c14434964ed792f4d83b' 
  AND (
    token = 'IpdDsIubOG/ntlCdzaiOJxCrZ4w3qs8hrWCv/7texzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027