UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'un4nbw9L3okjai2dKw/CWXJi4sTj5MwoKIgxCOJSBzk='
WHERE
key_id = '1e72b76edcb8557c27a76fafa3a4107efdfd6bb297252c02c46cad4c7ac8a6e0'
AND (
token = 'un4nbw9L3okjai2dKw/CWXJi4sTj5MwoKIgxCOJSBzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)