UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z4RTNeXKJ1kTEBV6eI1g4asbSHlrlVdZAZvfpGE0VAA=' 
WHERE 
  key_id = 'f960a3fc2240c9171b705af350302b6f3a43bc91b3218f0227b4c405398bcfc7' 
  AND (
    token = 'z4RTNeXKJ1kTEBV6eI1g4asbSHlrlVdZAZvfpGE0VAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038