UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tSPQwR4JWVvPHRzL/ry5tnsmUAUp/apmtQHXiI3nTC8='
WHERE
key_id = '568e12bc15b6afbab718fb9d58351db4e5a271f2a8a6d6c3c06140eb35c305f5'
AND (
token = 'tSPQwR4JWVvPHRzL/ry5tnsmUAUp/apmtQHXiI3nTC8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)