UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qSsbfTysh4v6flWfJj5GgCRRHbMDXhfQPs+Aq0UneLw='
WHERE
key_id = 'f85b169c4fa6abfa2c479f1ba9efa7116cdb21b1c58712b6e85e60fb2b37b692'
AND (
token = 'qSsbfTysh4v6flWfJj5GgCRRHbMDXhfQPs+Aq0UneLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)