UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9iHaTMwrVUtK2PTaRJCYtvcOlEMwR4DJ7JspAxpX400='
WHERE
key_id = '11c51307d2889159b541978b7626305b78dd2e314a7237697ada1f5f2ddf7b7c'
AND (
token = '9iHaTMwrVUtK2PTaRJCYtvcOlEMwR4DJ7JspAxpX400='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)