UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0bUJyu5L/ywuVaZZZQNjVN51Vf6B+eZyW6QYgqGpA5w=' 
WHERE 
  key_id = '43d3b9ebd8ac7fe36d91d0b93995f639f37b3a8ec0a4db1419559d1d6f2aff81' 
  AND (
    token = '0bUJyu5L/ywuVaZZZQNjVN51Vf6B+eZyW6QYgqGpA5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023