UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9rrJMeCZpGwlVg17Lan8wpE/rvlZtO/y+viukviOWQ8='
WHERE
key_id = 'fe83a5c64d5051872cdf40840a9059e20a363acaa31babed45c60197c0dc0af8'
AND (
token = '9rrJMeCZpGwlVg17Lan8wpE/rvlZtO/y+viukviOWQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)