UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bkbb+yTrqYHBhc9GikYusgZnvZ1X1Td4FpP5TvTqEuY='
WHERE
key_id = '3f64e6076c1c83ea74c4f19d23d55cc76d9f2833f55a532704b19bd6766c4739'
AND (
token = 'Bkbb+yTrqYHBhc9GikYusgZnvZ1X1Td4FpP5TvTqEuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)