UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qsFRWEI/cYH45xiRryoBynpWmDtq1Pwgd9l4dtFu/Lw='
WHERE
key_id = '3255c9bbe2790021549044eb295fe2b95d5aefbead8c330d35dc774fb3b3109d'
AND (
token = 'qsFRWEI/cYH45xiRryoBynpWmDtq1Pwgd9l4dtFu/Lw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)