UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IsuhL2X5HiWHIM6CUsnJBYj7+W2eDt6Ojx5dkxGb/Rk=' 
WHERE 
  key_id = 'c73c34e3f0db74d5b09b6ea4fa93aa72429a1c7f8dac817e92d2fecc0bbc3896' 
  AND (
    token = 'IsuhL2X5HiWHIM6CUsnJBYj7+W2eDt6Ojx5dkxGb/Rk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052