UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WD/RYkOSymUXgl+ku89Z5cT/zhhYwkTVRB7RYp/rtr4='
WHERE
key_id = 'cc26f3f19e316d4645f2fe87bbe56c8afc13c226932d55d596eb928846d22a3a'
AND (
token = 'WD/RYkOSymUXgl+ku89Z5cT/zhhYwkTVRB7RYp/rtr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)