UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '727NuwG4dnASrPgFgAlfEGuTwPlgRhb0yoaVaY98Vzk='
WHERE
key_id = '7450ed099728c0cdb03db8a19b7201a0e968d305698aae0b0197558208ca1ed9'
AND (
token = '727NuwG4dnASrPgFgAlfEGuTwPlgRhb0yoaVaY98Vzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)