UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7w74uDxkhWqfMg1cI4pjONWaD7rP/P3s+CN1l1FaKJI='
WHERE
key_id = 'c5de2ad8204bf05df0d6cef6f419a178dd5075d227c717158b7ac824d98337b0'
AND (
token = '7w74uDxkhWqfMg1cI4pjONWaD7rP/P3s+CN1l1FaKJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)