UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zQF02TUVm8vInmkb1a+iTjA2LK+qlG7Fia3wZb2oyTk=' 
WHERE 
  key_id = '1000404196871409378e339512c90ae749eef8dfb9b238cf41e94186d3032e02' 
  AND (
    token = 'zQF02TUVm8vInmkb1a+iTjA2LK+qlG7Fia3wZb2oyTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044