UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N4FG0obgLsYhiS2OVnlYd2yDrfQxuN4rBtUsEqEwjr4='
WHERE
key_id = '270c15dc130f487aa9ec04aa889aa37ee7a4a2e2002a1617b7bad579351c4498'
AND (
token = 'N4FG0obgLsYhiS2OVnlYd2yDrfQxuN4rBtUsEqEwjr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)