UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4WGSvMyQGhLv+9pU6GYDOhl3//E9sBMn9IhUf/Yaxno='
WHERE
key_id = 'e4db001ccc697d71b4debabed315a6e7b9142392cd9237ae8681d8c0a0883b77'
AND (
token = '4WGSvMyQGhLv+9pU6GYDOhl3//E9sBMn9IhUf/Yaxno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)