UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dvww3FL9lf+otvErcRReM8NfOfHOJ6M1SyBQWlHXwv0=' 
WHERE 
  key_id = 'ac6caee0938b7ad624f76f6623042977e9d63ac6df276beb7ae9430a4747e682' 
  AND (
    token = 'Dvww3FL9lf+otvErcRReM8NfOfHOJ6M1SyBQWlHXwv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041