UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CU16cqXrzUf9T/r/Mcras0YK2RYR4kGsNzBt1kf5STE='
WHERE
key_id = '3df63df2f83e4a3e306fdc5aa3c599d145f067fe99a9048335defcb1a77adfe3'
AND (
token = 'CU16cqXrzUf9T/r/Mcras0YK2RYR4kGsNzBt1kf5STE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)