UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AcnApsBWNXcqG+W74bSbwN7z5+WjXwIYFTTD1Y9nEhs=' 
WHERE 
  key_id = '6a69e0c9fdc32d1561ed200c7dc696b43a1f4d8fdfda195a2cec8086118700a0' 
  AND (
    token = 'AcnApsBWNXcqG+W74bSbwN7z5+WjXwIYFTTD1Y9nEhs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038