UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YutjhzXlHtiDh3ZrWQ+7HsvLijjmwzsh5EZPRIdCdsM='
WHERE
key_id = '3496ef4358750510ebb966b4fd628c38ebd1e3661ab7baddb75ab1651a8c8a01'
AND (
token = 'YutjhzXlHtiDh3ZrWQ+7HsvLijjmwzsh5EZPRIdCdsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)