UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '70OJ5M5GnQceRsQAM7JJFjmVX8uqCUn0VbQVeRRKhMw='
WHERE
key_id = 'c1130271dcce3300bf61574a608d8d044859993bd000e2bf4687d9b03fa1486f'
AND (
token = '70OJ5M5GnQceRsQAM7JJFjmVX8uqCUn0VbQVeRRKhMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)