UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XKWcRPRJTFg5bBqa9nevHE5tzMtl4znCOxBuC2YnU3A=' 
WHERE 
  key_id = '89dd89ca38231bb3a5bcf58c8726ba6b263a46a27ec167d56f1739142329df61' 
  AND (
    token = 'XKWcRPRJTFg5bBqa9nevHE5tzMtl4znCOxBuC2YnU3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030