UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dl7l2ALH/ISDO7NXQzSdc7bcECI8oJktUyyjKTTgzlM=' 
WHERE 
  key_id = 'd4290abd40793c458712721e84b5909e0e3b042993529482a206196a6440a4b3' 
  AND (
    token = 'Dl7l2ALH/ISDO7NXQzSdc7bcECI8oJktUyyjKTTgzlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038