UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VNGSheStNGM+6HR+y3LhkKHoyxGszqXoLobQ0Dy4bQY=' 
WHERE 
  key_id = 'a8e0b81f41b54997a9e0c1656298e60b7fff6eeb63cd68b7ee50c5c7ed4e60f7' 
  AND (
    token = 'VNGSheStNGM+6HR+y3LhkKHoyxGszqXoLobQ0Dy4bQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031