UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Q/ucgIrXCxRXkI8Vzy6GDCnrOIDylk7poo3itKJ4E4='
WHERE
key_id = '96f9002e14795b60acd7015a42f7f71444980bf75610a474db358e310ab22b3a'
AND (
token = '/Q/ucgIrXCxRXkI8Vzy6GDCnrOIDylk7poo3itKJ4E4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)