UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '69J/GAGvuVN3orlFOgxMJuRKDtHeSh/pJ/vH07+hpbk='
WHERE
key_id = 'a3b824edfaae277e6f2bfdb334ae5e14fc82b7b8766a5bbb058316b4901ca7c9'
AND (
token = '69J/GAGvuVN3orlFOgxMJuRKDtHeSh/pJ/vH07+hpbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)