UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VpnIkHYNpVhqDmuZfPQTFODqFhFYJ9ZygUcEc7bH8+o=' 
WHERE 
  key_id = '81437df1f6b4c68ad0c8b779f42f7d0af1537fa547b8c81c5eb4d0de9d906cd7' 
  AND (
    token = 'VpnIkHYNpVhqDmuZfPQTFODqFhFYJ9ZygUcEc7bH8+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042