UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ufV7YIgMHHjFMc7XtfLqS9edJP4vFWovH9/D7IZKM1k='
WHERE
key_id = '1ed7ccf04b39adac1d9e0573d9547cb66bfb7e2fffc622115b8521b2504dc3f1'
AND (
token = 'ufV7YIgMHHjFMc7XtfLqS9edJP4vFWovH9/D7IZKM1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)