UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+g+ZD3EN1u1QpTb+jVxBA7E3NLyZUKL0CAGli3fhrF0='
WHERE
key_id = 'c69ef7e90555d1263cad35c74de269cacad1b86d7a11af1fc80a9de8765b6b13'
AND (
token = '+g+ZD3EN1u1QpTb+jVxBA7E3NLyZUKL0CAGli3fhrF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)