UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wEB6+D+jxuu5nJiPsF3NVCsM3vcijYiYstDXzSkJfnY='
WHERE
key_id = 'cd3fa2dc7c9ac4f8b3cc382dc99a27f18c7d7f940151d367b7a973dbd7b41c7c'
AND (
token = 'wEB6+D+jxuu5nJiPsF3NVCsM3vcijYiYstDXzSkJfnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)