UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BIw1umK/rO11Ql5+0baRiIsm4Wm/bxPOISJJN8BudnU=' 
WHERE 
  key_id = 'dab8c22fdf0dda12ae0bb09eeba5451959cb3c47ca0235c17a8567583b6a4c63' 
  AND (
    token = 'BIw1umK/rO11Ql5+0baRiIsm4Wm/bxPOISJJN8BudnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016