UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mrm8dk7p5nOgw+QJjnpf+UH51uBYQrcZDFuuTOmDv74='
WHERE
key_id = 'f95d59309b0d21327e82b48fa463ae223f33a49aff12aca28c481e5c08a26ed3'
AND (
token = 'mrm8dk7p5nOgw+QJjnpf+UH51uBYQrcZDFuuTOmDv74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)