UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a1DMW6k/80kjQFlYEfopRbkoQ/rdha0eJIdC2nZNEpk='
WHERE
key_id = '71dc7df7f3acac5e6e16fa9374f1f133e37cef3e04927c0eb4c05b2748242afe'
AND (
token = 'a1DMW6k/80kjQFlYEfopRbkoQ/rdha0eJIdC2nZNEpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)