UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zj0tRs5u3hgvsKg2EvGG2WOSdSin2HGuGqEuSUAPXRA=' 
WHERE 
  key_id = '5cf419a0351b27ca537fc8a8a7fe59d428701f54973872a8bdde82d9732f9231' 
  AND (
    token = 'zj0tRs5u3hgvsKg2EvGG2WOSdSin2HGuGqEuSUAPXRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024