UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+qPjsLY5e6P3KleVBagcmMH8wAnQ5CaDnyGvRtajpF0=' 
WHERE 
  key_id = 'ce155522938066da6ed57d3dded3cf4e824864e4a176381a555b2f3acf6de741' 
  AND (
    token = '+qPjsLY5e6P3KleVBagcmMH8wAnQ5CaDnyGvRtajpF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036