UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q34RHUVgL4E0LSsQtvr/oFN2X0PuepBK4nw9LofmupI=' 
WHERE 
  key_id = '40736b1bf14e12f0827047bd369ac1e15f2d63efb12cae54fa8d394e523fa0ac' 
  AND (
    token = 'Q34RHUVgL4E0LSsQtvr/oFN2X0PuepBK4nw9LofmupI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019