UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eEqbV+loGw8BbIY+4zkW0/RT/ebxb38DZkU4IS2HFcM=' 
WHERE 
  key_id = 'bd0fd69b4fdaeb63178bd9f4d5b78d0cd2bf9383904285fa95dd4f5bbb9051b4' 
  AND (
    token = 'eEqbV+loGw8BbIY+4zkW0/RT/ebxb38DZkU4IS2HFcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029