UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZxaJu8R63BUFQ7l3SG9mgbYh7oz+VGX+xwyF2/4IvCY='
WHERE
key_id = '14dd9e3360cfa013dc95087ef85ffd10e36bfe5de0384b0605da6e2f763be7c7'
AND (
token = 'ZxaJu8R63BUFQ7l3SG9mgbYh7oz+VGX+xwyF2/4IvCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)