UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XlL9R9693lRw/ZVd3BTiD9Y6A0k56N8aoWYNOr964mM='
WHERE
key_id = '953d7647e9e774dcf4e6ef4a77ca48a50858ea4d72232f97fbb6c244a5e73c53'
AND (
token = 'XlL9R9693lRw/ZVd3BTiD9Y6A0k56N8aoWYNOr964mM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)