UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2DAc/13ZVRq+fY7owcVF4hM7jqTmn+ZwuqmIhtepw4c='
WHERE
key_id = 'bdd8eeb83943db67b6df68e56a4f699df08715c9393063711b42108ba31aa933'
AND (
token = '2DAc/13ZVRq+fY7owcVF4hM7jqTmn+ZwuqmIhtepw4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)