UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zzfpWRtacR/u7gP37x9yoKcq2HD1PAnyh2H4HtncCuU=' 
WHERE 
  key_id = '25f5e10029e898834d2113b108d68b32e1b8b3dd46ca6a53b75a9d3703d9fdbd' 
  AND (
    token = 'zzfpWRtacR/u7gP37x9yoKcq2HD1PAnyh2H4HtncCuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034