UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wdVlKuiuN/We6bIbmzNpinZltmhsZSO0rTsNf6btSGk=' 
WHERE 
  key_id = '8554d7362dc067da0492def63cbadf4f8251f7240061e828d4c5d05a2d94fbe6' 
  AND (
    token = 'wdVlKuiuN/We6bIbmzNpinZltmhsZSO0rTsNf6btSGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035