UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oMr1Yd2JYAKAtqqSZ8fjZsUW6G4mzD8JXpQ2VlC6LMg=' 
WHERE 
  key_id = '2719e0e6b93d76afc3c2c0b2cd7b12fa4b0d1d054931544bdb27ad42fa4458ed' 
  AND (
    token = 'oMr1Yd2JYAKAtqqSZ8fjZsUW6G4mzD8JXpQ2VlC6LMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039